#ifndef GDT_H
#define GDT_H

typedef struct gdt_entry_st
{
	unsigned short limit_lower;
	unsigned short base_lower;
	unsigned char base_middle;
	unsigned char access;
	unsigned char fl_limit_upper;
	unsigned char base_upper;
}__attribute__((packed)) gdt_entry;

typedef struct gdt_descriptor_st
{
	unsigned short size;
	unsigned int offset; 
}__attribute__((packed)) gdt_descriptor;

typedef struct tss_t
{
	unsigned short ptl;//Previous task link
	unsigned short r1;
	unsigned int esp0;
	unsigned short ss0;
	unsigned short r2;
	unsigned int esp1;
	unsigned short ss1;
	unsigned short r3;
	unsigned int esp2;
	unsigned short ss2;
	unsigned short r4;
	unsigned int cr3;
	unsigned int eip;
	unsigned int eflags;
	unsigned int eax;
	unsigned int ecx;
	unsigned int edx;
	unsigned int ebx;
	unsigned int esp;
	unsigned int ebp;
	unsigned int esi;
	unsigned int edi;
	unsigned short es;
	unsigned short r5;
	unsigned short cs;
	unsigned short r6;
	unsigned short ss;
	unsigned short r7;
	unsigned short ds;
	unsigned short r8;
	unsigned short fs;
	unsigned short r9;
	unsigned short gs;
	unsigned short r10;
	unsigned short ldt;
	unsigned short r11;
	unsigned short t;
	unsigned short iomapbase;
}__attribute__((packed)) TSS;

TSS global_tss;

#endif
